//------------------------------------------------------------------------------
// Copyright (c) 2008 www.dnaide.com
// Licensed under the MIT (MIT-LICENSE.txt)
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
using System.Globalization;
using System.Security.Cryptography;
using System.Text.RegularExpressions;
using System.Collections.Specialized;

namespace DNAide.Core
{
	public static partial class StringAide
	{

		/// <summary>
		/// Validates whether the string is an email address
		/// </summary>
		/// <param name="value">value</param>
		/// <returns>String</returns>
		public static Boolean IsEmailAddress(String value)
		{
			if (string.IsNullOrEmpty(value))
			{
				return false;
			}
			return Regex.IsMatch(value, @"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$", RegexOptions.IgnoreCase);
		}

	}
}

